From db6435aaa83042fa0843b33c0c76f63f6855e5a8 Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Wed, 19 Oct 2005 13:33:22 +0100 Subject: [PATCH] Added sedf_get functionality to XendClient interface. From David Isaac Wolinsky . Signed-off-by: Ewan Mellor --- tools/python/xen/lowlevel/xc/xc.c | 13 +++++++------ tools/python/xen/xend/XendClient.py | 4 ++++ tools/python/xen/xend/server/SrvDomain.py | 7 +++++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c index 8e49d8036f..b264615b3f 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -739,8 +739,8 @@ static PyObject *pyxc_xeninfo(PyObject *self, static PyObject *pyxc_sedf_domain_set(PyObject *self, - PyObject *args, - PyObject *kwds) + PyObject *args, + PyObject *kwds) { XcObject *xc = (XcObject *)self; uint32_t domid; @@ -762,8 +762,8 @@ static PyObject *pyxc_sedf_domain_set(PyObject *self, } static PyObject *pyxc_sedf_domain_get(PyObject *self, - PyObject *args, - PyObject *kwds) + PyObject *args, + PyObject *kwds) { XcObject *xc = (XcObject *)self; uint32_t domid; @@ -779,12 +779,13 @@ static PyObject *pyxc_sedf_domain_get(PyObject *self, &slice,&latency,&extratime,&weight) ) return PyErr_SetFromErrno(xc_error); - return Py_BuildValue("{s:i,s:L,s:L,s:L,s:i}", + return Py_BuildValue("{s:i,s:L,s:L,s:L,s:i,s:i}", "domain", domid, "period", period, "slice", slice, "latency", latency, - "extratime", extratime); + "extratime", extratime, + "weight", weight); } static PyObject *pyxc_domain_setmaxmem(PyObject *self, diff --git a/tools/python/xen/xend/XendClient.py b/tools/python/xen/xend/XendClient.py index 22f8fc7571..9fe93bab99 100644 --- a/tools/python/xen/xend/XendClient.py +++ b/tools/python/xen/xend/XendClient.py @@ -269,6 +269,10 @@ class Xend: 'warpl' : warpl, 'warpu' : warpu }) + def xend_domain_cpu_sedf_get(self, id): + return self.xendPost(self.domainurl(id), + {'op' : 'cpu_sedf_get'}) + def xend_domain_cpu_sedf_set(self, id, period, slice, latency, extratime, weight): return self.xendPost(self.domainurl(id), {'op' : 'cpu_sedf_set', diff --git a/tools/python/xen/xend/server/SrvDomain.py b/tools/python/xen/xend/server/SrvDomain.py index 5278506cc4..40ddc81972 100644 --- a/tools/python/xen/xend/server/SrvDomain.py +++ b/tools/python/xen/xend/server/SrvDomain.py @@ -105,6 +105,13 @@ class SrvDomain(SrvDir): return val + def op_cpu_sedf_get(self, op, req): + fn = FormFn(self.xd.domain_cpu_sedf_get, + [['dom', 'int']]) + val = fn(req.args, {'dom': self.dom.domid}) + return val + + def op_cpu_sedf_set(self, op, req): fn = FormFn(self.xd.domain_cpu_sedf_set, [['dom', 'int'], -- 2.30.2